package com.xmall.security;

import com.xmall.define.dto.login.SysLoginInfo;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * 系统用户：手机号+验证码登录token
 */
public class SysPhoneVerifyAuthenticationToken extends UsernamePasswordAuthenticationToken {

    public SysPhoneVerifyAuthenticationToken(Object principal, Object credentials) {
        super(principal, credentials);
    }

    public SysPhoneVerifyAuthenticationToken(SysLoginInfo loginInfo, Object principal) {
        super(principal, "");
        this.setDetails(loginInfo);
    }

    public SysPhoneVerifyAuthenticationToken(SysLoginInfo loginInfo, Object principal, Collection<? extends GrantedAuthority> authorities) {
        super(principal, "", authorities);
        this.setDetails(loginInfo);
    }

}
